import requests
import execjs


url = 'https://match.yuanrenxue.cn/api/match/2?page=%s'
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
}
cookies = {}
cookies['seesionid'] = '4n06n2jpo9iyk0bx2l6vshosizkrk25n'
js_code = open('jscode.js', 'r', encoding='utf-8').read()
js_compile = execjs.compile(js_code)
result = 0
for i in range(1, 6):
    cookie_m = js_compile.call('run')
    cookies['m'] = cookie_m
    response = requests.get(url%i, headers=headers, cookies=cookies)
    json_data = response.json()
    for dic in json_data.get('data'):
        result += dic.get('value')
print(result)